package com.qys.livesMall.app.user.service;

import com.qys.livesMall.app.user.model.entity.AppUserRelation;
import com.baomidou.mybatisplus.extension.service.IService;
import com.qys.livesMall.app.user.model.entity.H2AppUser;

import java.util.List;

/**
 * <p>
 * 用户关系 服务类
 * </p>
 *
 * @author
 * @since 2023-10-13
 */
public interface AppUserRelationService extends IService<AppUserRelation> {

    List<AppUserRelation> init(Long userId, Long parent);

    void remove(Long userId);
    List<H2AppUser> getLowerLevels(Long userId);

    List<Long> getUserLowerLevels(Long userId);

    /**
     * 获取下级
     * @param userId
     * @param level 下level级
     * @return
     */

    List<H2AppUser> getLowerLevels(Long userId,Integer level);

    List<H2AppUser> getLowerLevels(Long userId,List<Integer> levels);

    List<Long> getUserLowerLevels(Long userId,List<Integer> levels);

    List<Long> getUserLowerLevels(Long userId,Integer level);
    /**
     * 大于第n层
     * @param userId
     * @param level
     * @return
     */
    List<H2AppUser> getGreaterLevels(Long userId, Integer level);

    List<Long> getLowerLevels(String userName,Integer level);

    List<Long> getLowerLevels(String userName, List<Integer> levels);

    List<Long> getGreaterLevels(String userName,Integer level);

    /**
     * 查询 真实，状态正常，充值用户
     * @param userIds
     * @return
     */
    List<Long> getValidUser(List<Long> userIds);


    /**
     * 查询 真实，状态正常 用户，充值店铺
     * @param userIds
     * @return
     */
    List<Long> getValidShop(List<Long> userIds);


    /**
     * 查询 真实，状态正常，充值用户 大于等于1
     * @param userIds
     * @return
     */
    List<Long> getGradeValidUser(List<Long> userIds);
}
